Teaching the Construction of Correct Programs Using Invariant Based Programming
نویسنده
چکیده
In most computer science curricula, formal reasoning about program correctness is taught separately from practical programming, and is thus by most students considered a purely theoretical activity. It has been a challenge to convince students of the practical applicability of formal methods. We present here an effort to apply Invariant Based Programming (IBP), a visual and practical program construction and verification methodology, in an introductory formal methods course as part of a pilot study at Åbo Akademi University. The course introduces a minimum of notational overhead, and allows the student to reason about correctness using mathematical concepts with which they are already familiar (such as set theory). We have used a programming environment with theorem prover support (SOCOS) to increase student confidence in the correctness of the program components that they construct. We evaluate the course using a mixed method approach, and provide data which show that IBP is well suited for teaching introductory formal methods.
منابع مشابه
Invited Keynote Talk Invariant Based Programming
There are a few standard approaches to constructing verified programs. The original approach, by Floyd, Naur and Hoare, assumes that the program code is given, together with an informal description of what the program is supposed to do. Program verification amounts to expressing the requirements as precise preand postconditions, finding the appropriate loop invariants, constructing the verifica...
متن کاملInvariant based programming in education - An analysis of student difficulties
In this paper, we analyze the errors novice students make when developing invariant based programs. In addition to presenting the general error types, we also look at what students have difficulty with when it comes to expressing invariants. The results indicate that an introductory course utilizing the invariant based approach is suitable from the very beginning of university studies in CS wit...
متن کاملInvariant Based Programming Revisited
Program verification is usually done by adding specifications and invariants to the program and then proving that the verification conditions are all true. This makes program verification an alternative to or a complement to testing. We study here an another approach to program construction, which we refer to as invariant based programming, where we start by formulating the specifications and t...
متن کاملSemantics and Data Refinement of Invariant Based Programs
The invariant based programming is a technique of constructing correct programs by first identifying the basic situations (preand post-conditions and invariants) that can occur during the execution of the program, and then defining the transitions and proving that they preserve the invariants. Data refinement is a technique of building correct programs working on concrete datatypes as refinemen...
متن کاملAn Exercise in Invariant-based Programming with Interactive and Automatic Theorem Prover Support
Invariant-Based Programming (IBP) is a diagram-based correct-by-construction programming methodology in which the program is structured around the invariants, which are additionally formulated before the actual code. Socos is a program construction and verification environment built specifically to support IBP. The front-end to Socos is a graphical diagram editor, allowing the programmer to con...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007